<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>尊敬的员工：{$nickname}</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=0">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<link rel="stylesheet" href="/newstatic/css/project.css" />
		<script src="__PERSON__/js/jquery.min.js"></script>
		<script src="__PERSON__/js/zui.min.js"></script>
	</head>

	<body>
		<div style="position:absolute;z-index:2000;left:30%;top:35%;display:none;" id="loading">
			<img src="/static/timg.gif" style="opacity:0.4;filter:alpha(opacity=40);width: 150px;height: 100px;" />
		</div>
		<div style="position:absolute;z-index:2000;left:30%;top:35%;display:none;font-size:6vw;color:red;background:#ff9933;width:50%;text-align:center;padding-top:30px;padding-bottom:30px;border-radius:20px 20px;" id="loading1">

		</div>
		<header>
			<div class="header center">
				<img src="/newstatic/img/logo.png" />
				<p>鑫诺洁家庭服务有限公司</p>
			</div>
		</header>
		<nav>
			<div class="nav1 active">
				<i class="iconfont">&#xe67d;</i>
				<p>营销工具</p>
			</div>
			<div class="nav2" id="fltab">
				<i class="iconfont">&#xe653;</i>
				<p>我的福利</p>
			</div>
			<div class="nav3">
				<i class="iconfont" id="pbtab">&#xe656;</i>
				<p>我的排班</p>
			</div>

		</nav>
		<div class="part1_top">
			<img src="/newstatic/img/tou.jpg" />
			<p>{$nickname}</p>
			<p>美好的一天，从家居清洁开始</p>
		</div>
		<article class="part1">
			<volist name="market_tools" id="info">
				<a href="#">
					<div class="part1_content">
						<p>{$info['title']}</p>
						<if condition="$info['cover_id'] gt 0">
							<i class="iconfont">&#xe65b;</i>
							<elseif condition="$info['link'] neq ''" />
							<i class="iconfont">&#xe65b;</i>
						</if>
					</div>
				</a>
			</volist>

		</article>
		<article class="part2">
			<div class="part2_time">
				<div class="time_header">
					<div class="prev" data="{$lastmonth}" id="lastmonth0">
						<i class="iconfont">&#xe659;</i> 上个月
					</div>
					<div class="year" id="curtime0">
						<?php echo date('Y年m月');?>
					</div>
					<div class="next" data="{$nextmonth}" id="nextmonth0">下个月
						<i class="iconfont">&#xe673;</i>
					</div>
					<br />
					<div class="time_tab">
						<ul>
							<li>底薪</li>
							<li id="dx"></li>
							<li>基础时长</li>
							<li id="jssc"></li>
						</ul>
						<ul>
							<li>已完成</li>
							<li id="ywc"></li>
							<li>工时奖金</li>
							<li id="gsjj"></li>
						</ul>
						<ul>
							<li>销售提成</li>
							<li id="xstc"></li>
							<li>扣款</li>
							<li id="kk"></li>
						</ul>
						<ul>
							<li>应发工资</li>
							<li id="yfgz"></li>
							<li>预期工资</li>
							<li id="yqgz"></li>
						</ul>
					</div>
				</div>
			</div>
			<div class="part2_tab" id="box0">
				<img src="/static/xloading.gif" style="opacity:0.4;filter:alpha(opacity=40);" />

			</div>
		</article>
		<article class="part3" >
			<div class="part2_time" style="height:0px">
				<div class="prev" data="{$lastmonth}" id="lastmonth">
					<i class="iconfont">&#xe659;</i> 上个月
				</div>
				<div class="year" id="curtime">
					<?php echo date('Y年m月');?>
				</div>
				<div class="next" data="{$nextmonth}" id="nextmonth">
					下个月
					<i class="iconfont">&#xe673;</i>
				</div>
				
			</div>
			<br />
			<div id="flbox">
				
			</div>
		</article>

	</body>
	<script type="text/javascript" src="/newstatic/js/project.js"></script>
	<script type="text/javascript">
			var time={$time|default=0};
			var emp_id={$relation_emp_id};
			var time0={$time|default=0};
			$(document).ready(
				function (e){
					$("#pbtab").click(
						function (e){							
							getfrommonth(time);
						}
					);
					$("#lastmonth,#nextmonth").click(function (e){
						getfrommonth($(this).attr('time'));
					});	
						$("#fltab").click(
						function (e){							
							getfrommonth0(time0);
						}
					);
					$("#lastmonth0,#nextmonth0").click(function (e){
						getfrommonth0($(this).attr('time'));
					});	
					$("#flbox").on('click','.s-date,.s-address,.s-hour,.s-dian,.s-text',function (e){
						$("#loading").show();
						window.location.href='/welfarestaffdetails?id='+$(this).parents('ul').attr('data');
					});
				}
			);
			function getfrommonth0(time0){
									$("#box0").html('<ul><li><img src="/static/xloading.gif" style="opacity:0.4;filter:alpha(opacity=40);"/></li></ul>');
									$.ajax({
											type:'post',
											url:'/getflbystaff',
											dataType:'json',
											data:{time:time0,emp_id:emp_id},
											success:function (d){
													//$("#wan").html(d['totalmoney_wan']+"元");
													//$("#nowan").html(d['totlemoney_nowan']+"元");
													
													time0=d['curtime']['time'];
													$("#curtime0").html(d['curtime']['timeformat']);													
													$("#dx").html(d['emp_info']['salary']+"元");
													$("#jssc").html(d['emp_info']['month_time']+"小时");
													$("#ywc").html(d['total_time']+"小时");
													$("#gsjj").html(d['outtime_money']+"元");
													$("#xstc").html(d['tc_money_wc']+"元");
													$("#kk").html(d['leve_money']+"元");
													$("#yfgz").html(d['salary']+"元");
													$("#yqgz").html(d['salary_yq']+"元");													
													$("#nextmonth0").attr('time',d['nexttime']['time']);
													$("#lastmonth0").attr('time',d['lasttime']['time']);
													$("#box0").html('');
													for(var i in d['pbblist']){
															var curlist=d['pbblist'][i];
															for(var ii in curlist){
																var currow=curlist[ii];
																if(currow['istc']>0){
																var str='<ul><li>'+currow['ptimeformat']+'</li><li>'+currow['weixin_name']+'</li><li>'+currow['eve_time']+'小时</li><li>'+(currow['iscomplete']>0?'已服务':'未服务')+'</li><li>'+currow['ticheng']+'元</li></ul>';
	
																}else{
																var str='<ul><li>'+currow['ptimeformat']+'</li><li>'+currow['weixin_name']+'</li><li>'+currow['eve_time']+'小时</li><li>'+(currow['iscomplete']>0?'已服务':'未服务')+'</li><li>-</li></ul>';

																}
																$("#box0").append(str);
															}
													}
											}
										}
										);
									}
			function getfrommonth(time){
									$("#flbox").html('<ul><li><img src="/static/xloading.gif" style="opacity:0.4;filter:alpha(opacity=40);"/></li></ul>');
									$.ajax({
											type:'post',
											url:'/getpbbystaff',
											dataType:'json',
											data:{time:time,emp_id:emp_id},
											success:function (d){
													//$("#wan").html(d['totalmoney_wan']+"元");
													//$("#nowan").html(d['totlemoney_nowan']+"元");
													time=d['curtime']['time'];
													$("#curtime").html(d['curtime']['timeformat']);
													$("#nextmonth").attr('time',d['nexttime']['time']);
													$( "#lastmonth").attr('time',d['lasttime']['time']);
													$("#flbox").html('');
													for(var i in d['pbblist']){
															var currow=d['pbblist'][i];
															var str='<ul data='+currow['id']+'><li class="s-data">'+currow['ptimeformat']+'</li><li class="s-address">'+currow['address']+'</li><li  class="s-hour">'+currow['eve_time']+'小时</li><li class="s-text">'+currow['statustxt']+'</li><li class="s-dian"><a href="/welfarestaffdetails?id='+currow['id']+'&ly=1" class="ws-liuyan">'+(currow['issee']<1?'<i></i>':'')+'</a></li></ul>';
															$("#flbox").append(str);
													}
											}
										}
										);
									}
		</script>
   
</html>